#include "mpLog.h"
#include "mpFileUtils.h"
#include "mpLocaleUtils.h"
#include "mpLocaleUtilsTests.h"


mpLocaleUtilsTests::mpLocaleUtilsTests()
{
}
void mpLocaleUtilsTests::initTestCase(){}
void mpLocaleUtilsTests::cleanupTestCase(){}


void mpLocaleUtilsTests::case_other(){

#ifdef TEST_STRATEGY_COMPLETED

    std::string gbk_filepath = MP::FileUtils::get_appdir() + PATH_DELIM + "gbk.txt";
    std::string gbk_content = "";
    MP::FileUtils::get_file_content(gbk_filepath,gbk_content);

    std::string utf8_filepath = MP::FileUtils::get_appdir() + PATH_DELIM + "uft8.txt";
    std::string utf8_content = "";
    MP::FileUtils::get_file_content(utf8_filepath,utf8_content);


    std::wstring utf8ToUnicode = MP::LocaleUtils::u8string_to_unicode(utf8_content);
    std::string unicodeToUtf8 = MP::LocaleUtils::unicode_to_u8string(utf8ToUnicode);

    QVERIFY2(unicodeToUtf8 == utf8_content,"string_to_wstring then wstring_to_string");

#ifdef PLATFORM_WINDOWS

    std::string utf8ToGBK = MP::LocaleUtils::u8string_to_sys_encoding(utf8_content);
    QVERIFY2(utf8ToGBK == gbk_content,"utf8_to_sys_encoding");

    std::string gbkToUtf8 = MP::LocaleUtils::sys_encoding_to_u8string(gbk_content);
    QVERIFY2(gbkToUtf8 == utf8_content,"sys_encoding_to_utf8");

#endif //PLATFORM_WINDOWS


#endif


}
